
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
Choosing a presentation style </TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="pbugp161.htm">Previous</A>&nbsp;&nbsp;<A HREF="pbugp163.htm" >Next</A>
<!-- End Header -->
<A NAME="CFHBFAAA"></A><h1>Choosing a presentation style </h1>
<A NAME="TI4878"></A><p>The presentation style you select for a DataWindow object determines
the format PowerBuilder uses to display the DataWindow object in the Design view.
You can use the format as displayed or modify it to meet your needs.</p>
<A NAME="TI4879"></A><p>When you create a DataWindow object, you can choose from the presentation styles
listed in the following table.</p>
<A NAME="TI4880"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 18-1: DataWindow presentation styles</caption>
<tr><th  rowspan="1"  ><A NAME="TI4881"></A>Using this DataWindow wizard</th>
<th  rowspan="1"  ><A NAME="TI4882"></A> You create a new DataWindow object</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4883"></A>Composite</td>
<td  rowspan="1"  ><A NAME="TI4884"></A>That includes other DataWindow objects</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4885"></A>Crosstab</td>
<td  rowspan="1"  ><A NAME="TI4886"></A>With summary data in a spreadsheet-like
grid</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4887"></A>Freeform</td>
<td  rowspan="1"  ><A NAME="TI4888"></A>With the data columns going down the
page and labels next to each column</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4889"></A>Graph</td>
<td  rowspan="1"  ><A NAME="TI4890"></A>With data displayed in a graph</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4891"></A>Grid</td>
<td  rowspan="1"  ><A NAME="TI4892"></A>With data in row and column format with
grid lines separating rows and columns</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4893"></A>Group</td>
<td  rowspan="1"  ><A NAME="TI4894"></A>With data in rows that are divided into
groups</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4895"></A>Label</td>
<td  rowspan="1"  ><A NAME="TI4896"></A>That presents data as labels</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4897"></A>N-Up</td>
<td  rowspan="1"  ><A NAME="TI4898"></A>With two or more rows of data next to
each other</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4899"></A>OLE 2.0</td>
<td  rowspan="1"  ><A NAME="TI4900"></A>That is a single OLE object</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4901"></A>RichText</td>
<td  rowspan="1"  ><A NAME="TI4902"></A>That combines input fields that represent
database columns with formatted text</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4903"></A>Tabular</td>
<td  rowspan="1"  ><A NAME="TI4904"></A>With data columns going across the page
and headers above each column</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI4905"></A>TreeView</td>
<td  rowspan="1"  ><A NAME="TI4906"></A>With data grouped in rows in a TreeView;
the TreeView displays the data hierarchically in a way that allows
you to expand and collapse it</td>
</tr>
</table>
<A NAME="TI4907"></A><h2>Using the Tabular style</h2>
<A NAME="TI4908"></A><p>The Tabular presentation style presents data with the data
columns going across the page and headers above each column. As
many rows from the database will display at one time as can fit
in the DataWindow object. You can reorganize the default layout any way
you want by moving columns and text:</p>
<br><img src="images/defin18.gif">
<A NAME="TI4909"></A><h2>Using the Freeform style</h2>
<A NAME="TI4910"></A><p>The Freeform presentation style presents data with the data
columns going down the page and labels next to each column. You
can reorganize the default layout any way you want by moving columns
and text. The Freeform style is often used for data entry forms.</p>
<br><img src="images/defin19.gif">
<A NAME="TI4911"></A><h2>Using the Grid style</h2>
<A NAME="TI4912"></A><p>The Grid presentation style shows data in row-and-column format
with grid lines separating rows and columns. With other styles,
you can move text, values, and other objects around freely in designing
the report. With the grid style, the grid lines create a rigid structure
of cells.</p>
<A NAME="TI4913"></A><p>An advantage of the Grid style is that users can reorder
and resize columns at runtime.</p>
<A NAME="TI4914"></A><h4>Original Grid report</h4>
<A NAME="TI4915"></A><p>This grid report shows employee information. Several of the
columns have a large amount of extra white space: </p>
<br><img src="images/defin20.gif">
<A NAME="TI4916"></A><h4>Grid report with modified column widths</h4>
<A NAME="TI4917"></A><p>This grid report was created from the original one by decreasing
the width of some columns:</p>
<br><img src="images/defin21.gif">
<A NAME="TI4918"></A><h2>Using the Label style</h2>
<A NAME="TI4919"></A><p>The Label presentation style shows data as labels. With this
style you can create mailing labels, business cards, name tags,
index cards, diskette labels, file folder labels, and many other
types of labels.</p>
<A NAME="TI4920"></A><h4>Mailing labels</h4>
<br><img src="images/defin22.gif">
<A NAME="TI4921"></A><h4>Business
cards</h4>
<br><img src="images/defin23.gif">
<A NAME="TI4922"></A><h4>Name tags</h4>
<br><img src="images/defin24.gif">
<A NAME="TI4923"></A><h4>Specifying label properties</h4>
<A NAME="TI4924"></A><p>If you choose the Label style, you are asked to specify the
properties for the label after specifying the data source. You can
choose from a list of predefined label types or enter your own specifications
manually. </p>
<A NAME="TI4925"></A><h4>Where label definitions come from</h4>
<A NAME="TI4926"></A><p>PowerBuilder gets the information about the predefined label
formats from a preferences file called <i>pblab115.ini</i>.</p>
<A NAME="TI4927"></A><h2>Using the N-Up style</h2>
<A NAME="TI4928"></A><p>The N-Up style presents two or more rows of data next to each
other. It is similar to the Label style in that you can have information
from several rows in the database across the page. However, the
information is not meant to be printed on labels. The N-Up presentation
style is useful if you have periodic data; you can set it up so
that each period repeats in a row.</p>
<A NAME="TI4929"></A><p>After you select a data source, you are asked how many rows
to display across the page.</p>
<A NAME="TI4930"></A><p>For each column in the data source, PowerBuilder defines <i>n</i> columns
in the DataWindow object (<b>column_1</b> to <b>column_</b><i>n</i>),
where <i>n</i> is the number of rows you specified.</p>
<A NAME="TI4931"></A><h4>Table example</h4>
<A NAME="TI4932"></A><p>For a table of daily stock prices, you can define the DataWindow object as
five across, so each row in the DataWindow object displays five days' prices (Monday
through Friday). Suppose you have a table with two columns, <b>day</b> and <b>price</b>,
that record the closing stock price each day for three weeks.</p>
<A NAME="TI4933"></A><p>In the following n-up DataWindow object, 5 was selected as the number
of rows to display across the page, so each line in the DataWindow object shows five
days' stock prices. A computed field was added to get the
average closing price in the week:</p>
<br><img src="images/defin25.gif">
<p><img src="images/note.gif" width=17 height=17 border=0 align="bottom" alt="Note"> <span class=shaded>About computed fields in n-up DataWindow objects</span> <A NAME="TI4934"></A>You use subscripts, such as price[0], to
refer to particular rows in the detail band in n-up DataWindow objects.</p>
<A NAME="TI4935"></A>For more information, see <A HREF="pbugp175.htm#CAICGCGD">Chapter 19, "Enhancing DataWindow Objects ."</A></p>
<A NAME="TI4936"></A><p>Here is the DataWindow object in the Preview view:</p>
<br><img src="images/defin26.gif">
<p><img src="images/note.gif" width=17 height=17 border=0 align="bottom" alt="Note"> <span class=shaded>Another way to get multiple-column DataWindow objects</span> <A NAME="TI4937"></A>In an n-up DataWindow object, the data is displayed across
and then down. If you want your data to go down the page and then
across in multiple columns, as in a phone list, you should create
a standard tabular DataWindow object, then specify newspaper columns.</p>
<A NAME="TI4938"></A>For more information on newspaper columns,
see <A HREF="pbugp175.htm#CAICGCGD">Chapter 19, "Enhancing DataWindow Objects ."</A></p>
<A NAME="TI4939"></A><h2>Using the Group style</h2>
<A NAME="TI4940"></A><p>The Group presentation style provides an easy way to create
grouped DataWindow objects, where the rows are divided into groups, each
of which can have statistics calculated for it. Using this style
generates a tabular DataWindow object that has grouping properties defined.</p>
<A NAME="TI4941"></A><p>This Group style report groups by department and lists employees
and salaries. It also includes a subtotal and a grand total for
the salary column:</p>
<br><img src="images/defin06.gif">
<A NAME="TI4942"></A><p>For more about the Group presentation style,
see <A HREF="pbugp210.htm#BFCBAIEB">Chapter 23, "Filtering, Sorting, and
Grouping Rows ."</A></p>
<A NAME="CDCBEIEI"></A><h2>Using the Composite style</h2>
<A NAME="TI4943"></A><p>The Composite presentation style allows you to combine multiple DataWindow objects
in the same object. It is particularly handy if you want to print
more than one DataWindow object on a page.</p>
<A NAME="TI4944"></A><p>This composite report consists of three nested tabular reports.
One of the tabular reports includes a graph:</p>
<br><img src="images/defin13.gif">
<A NAME="TI4945"></A><p>For more about the Composite presentation
style, see <A HREF="pbugp219.htm#BFCEAGEF">Chapter 25, "Using Nested Reports ."</A></p>
<A NAME="TI4946"></A><h2>Using the Graph and Crosstab styles</h2>
<A NAME="TI4947"></A><p>In addition to the (preceding) text-based presentation styles, PowerBuilder provides
two styles that allow you to display information graphically: Graph and
Crosstab. </p>
<A NAME="TI4948"></A><p>There is a graph report in the composite report in <A HREF="pbugp162.htm#CDCBEIEI">"Using the Composite style"</A>. This crosstab
report counts the number of employees that fit into each cell. For
example, there are three employees in department 100 who make between $30,000
and $39,999:</p>
<br><img src="images/defin12.gif">
<A NAME="TI4949"></A><p>For more information about these two presentation
styles, see <A HREF="pbugp224.htm#CCJCJJAE">Chapter 26, "Working with Graphs ,"</A> and <A HREF="pbugp230.htm#CBBEBEEI">Chapter 27, "Working with Crosstabs ."</A></p>
<A NAME="TI4950"></A><h2>Using the OLE 2.0 style</h2>
<A NAME="TI4951"></A><p>The OLE presentation style lets you link or embed an OLE object
in a DataWindow object.</p>
<A NAME="TI4952"></A><p>For information about the OLE 2.0 presentation
style, see <A HREF="pbugp257.htm#CCJBFGBD">Chapter 31, "Using OLE in a DataWindow Object ."</A></p>
<A NAME="TI4953"></A><h2>Using the RichText style</h2>
<A NAME="TI4954"></A><p>The RichText presentation style lets you combine input fields
that represent database columns with formatted text.</p>
<A NAME="TI4955"></A><p>For more information about the RichText presentation
style, see <A HREF="pbugp252.htm#CIHBJDJF">Chapter 30, "Working with Rich Text ."</A></p>
<A NAME="TI4956"></A><h2>Using the TreeView style</h2>
<A NAME="TI4957"></A><p>The TreeView presentation style provides an easy way to create DataWindow objects
that display hierarchical data in a TreeView, where the rows are
divided into groups that can be expanded and collapsed. Icons (+ or &#8211;)
show whether the state of a group in the TreeView is expanded or
collapsed, and lines connect parents and their children.</p>
<A NAME="TI4958"></A><p>This TreeView style report groups by manager ID and state
and lists employee information and salaries:</p>
<br><img src="images/tvdw.gif">
<A NAME="TI4959"></A><p>For more about the TreeView presentation style,
see <A HREF="pbugp236.htm#BAZCFDAI">Chapter 28, "Working with TreeViews."</A> </p>

